#!/usr/bin/env sh
. "$(dirname -- "$0")/_/husky.sh"
# Get a list of the staged files$files=$(git diff --cached --name-only --diff-filter=ACM -- '*.ts' | grep '^src/')
staged_files=$(git diff --cached --name-only --diff-filter=ACM -- '*.ts' | grep '^src/' || true)

# Run npm lint on the staged files
if [ -n "$staged_files" ]; then
  #log files
  echo 'linting the following commited files:' $staged_files
  npx eslint --ext .ts --max-warnings 0 $staged_files
  npm run test:types
fi